/*
 * @lc app=leetcode.cn id=240 lang=javascript
 *
 * [240] 搜索二维矩阵 II
 */

// @lc code=start
/**
 * @param {number[][]} matrix
 * @param {number} target
 * @return {boolean}
 */
var searchMatrix = function(matrix, target) {
    let line=matrix.length-1
    let column=0
    while(line>=0&&column<=matrix[0].length-1){
        if(matrix[line][column]==target){
            return true
        }else if(matrix[line][column]<target){
            column++
        }else{
            line--
        }
    }
    return false
};
// @lc code=end

